<%@ page language="java" contentType="text/html; charset=UTF-8"

         pageEncoding="UTF-8" %>

<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">

<html lang="en">

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>注册</title>

    <style>
        body {
            background: url(img/login.png)
        }

        div {
            height: 400px;
            width: 600px;
            opacity: 0.5;
            background-color: white;
            color: red;
            border: 2px solid #3333ff;
            margin: auto;
            margin-top: 100px;
        }

        input {
            height: 30px;
            width: 200px;
            margin-top: 10px;
        }

        #su {
            height: 30px;
            width: 100px;
        }

    </style>
</head>

<body>
<center><h1>人才市场系统注册</h1></center>
<br>
<div>
    <form action="registerservlet" method="get">
        <center>账号:<input type="text" name="id" class="txtb" placeholder="请输入账号"></center>
        <br>
        <center>姓名:<input type="text" name="name" class="txtb" placeholder="请输入姓名"></center>
        <br>
        <center>密码:<input type="password" name="password1" class="txtb1" placeholder="请输入密码"></center>
        <br>
        <center>密码:<input type="password" name="password2" class="txtb2" placeholder="再次输入密码"></center>
        <br>

        <center>

            <input type="radio" name="job" id="employer" value="我要招聘" class="radiob" checked="checked"/>
            <label>我要招聘</label>

            <input type="radio" name="job" id="seeker" value="我要求职" class="radiob"> <label>我要求职</label>

        </center>
        <br>
        <center>

            <input id="su" type="submit" value="注册" onclick="validateLogin()">

        </center>
        <br>


        <center><a href="login.jsp">已注册？去登录</a></center>
    </form>
</div>
<script language="javaScript">

    function validateLogin() {
        var sUserName = document.frmLogin.id.value;
        var sPassword1 = document.frmLogin.password1.value;
        var sPassword2 = document.frmLogin.password2.value;
        if (sUserName == "" || sPassword == "") {
            alert("用户名或密码不能为空！");
            return false;
        }
        if (sUserName.length() > 20) {
            alert("用户名不能超过20个字符！");
            return false;
        }
        if (sPassword.length() > 10) {
            alert("密码不能超过10位！");
            return false;
        }
        if (sPassword1 != sPassword2) {
            alert("密码不一致，请检查")
            return false;
        }
    }
</script>
</body>

</html>